iommu: make some functions (mainly MSI-related) dummy on IA64 for now.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 20 Oct 2008 14:13:02 +0000 (15:13 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 20 Oct 2008 14:13:02 +0000 (15:13 +0100)
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
xen/drivers/passthrough/io.c
xen/drivers/passthrough/pci.c
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/utils.c
xen/include/asm-x86/hvm/irq.h

index d5a337ab084ff1bc68ce3d62c67c0677e9e379be..a74fcb2f89539def010501160aee7a8712c23537 100644 (file)
@@ -20,6 +20,9 @@
 
 #include <xen/event.h>
 #include <xen/iommu.h>
+#include <asm/hvm/irq.h>
+#include <asm/hvm/iommu.h>
+#include <xen/hvm/irq.h>
 
 static void pt_irq_time_out(void *data)
 {
@@ -245,6 +248,7 @@ int hvm_do_IRQ_dpci(struct domain *d, unsigned int mirq)
     return 1;
 }
 
+#ifdef SUPPORT_MSI_REMAPPING
 void hvm_dpci_msi_eoi(struct domain *d, int vector)
 {
     struct hvm_irq_dpci *hvm_irq_dpci = d->arch.hvm_domain.irq.dpci;
@@ -277,6 +281,7 @@ void hvm_dpci_msi_eoi(struct domain *d, int vector)
 
     spin_unlock(&d->event_lock);
 }
+#endif
 
 void hvm_dpci_eoi(struct domain *d, unsigned int guest_gsi,
                   union vioapic_redir_entry *ent)
index da39b475f2542c1d9cc205a36f44b22f57f6b081..72c123ada4b52a2dafcf71980165db8318a76f1a 100644 (file)
@@ -21,6 +21,8 @@
 #include <xen/list.h>
 #include <xen/prefetch.h>
 #include <xen/iommu.h>
+#include <asm/hvm/iommu.h>
+#include <asm/hvm/irq.h>
 #include <xen/delay.h>
 #include <xen/keyhandler.h>
 
@@ -207,6 +209,7 @@ void pci_release_devices(struct domain *d)
     }
 }
 
+#ifdef SUPPORT_MSI_REMAPPING
 static void dump_pci_devices(unsigned char ch)
 {
     struct pci_dev *pdev;
@@ -236,7 +239,7 @@ static int __init setup_dump_pcidevs(void)
     return 0;
 }
 __initcall(setup_dump_pcidevs);
-
+#endif
 
 
 /*
index 6009871575245bd003c75c53005838c1efa85b48..dd5d7a4e79ad5d6d554fbc5f38f99bde657d0f6b 100644 (file)
@@ -24,6 +24,7 @@
 #include <xen/xmalloc.h>
 #include <xen/domain_page.h>
 #include <xen/iommu.h>
+#include <asm/hvm/iommu.h>
 #include <xen/numa.h>
 #include <xen/time.h>
 #include <xen/pci.h>
@@ -857,6 +858,7 @@ static void dma_msi_data_init(struct iommu *iommu, int vector)
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
 
+#ifdef SUPPORT_MSI_REMAPPING
 static void dma_msi_addr_init(struct iommu *iommu, int phy_cpu)
 {
     u64 msi_address;
@@ -873,6 +875,12 @@ static void dma_msi_addr_init(struct iommu *iommu, int phy_cpu)
     dmar_writel(iommu->reg, DMAR_FEUADDR_REG, (u32)(msi_address >> 32));
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 }
+#else
+static void dma_msi_addr_init(struct iommu *iommu, int phy_cpu)
+{
+    /* ia64: TODO */
+}
+#endif
 
 static void dma_msi_set_affinity(unsigned int vector, cpumask_t dest)
 {
index 4404a1f1c1a372072fb4f66b970f56740c22c86c..c720030c0a1921f6d1e22257321fe55ed0ea6e42 100644 (file)
@@ -204,6 +204,7 @@ void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn)
 
 void dump_iommu_info(unsigned char key)
 {
+#if defined(__i386__) || defined(__x86_64__)
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
     int i;
@@ -305,6 +306,10 @@ void dump_iommu_info(unsigned char key)
             }
         }
     }
+#else
+    printk("%s: not implemnted on IA64 for now.\n", __func__);
+    /* ia64: TODO */
+#endif
 }
 
 /*
index 89a799f6010ea38f05bc6c21220700d15564ac58..f2220526fd542bb6ece6b992d7625398fd69a4ca 100644 (file)
@@ -102,4 +102,12 @@ struct hvm_irq {
 struct hvm_intack hvm_vcpu_has_pending_irq(struct vcpu *v);
 struct hvm_intack hvm_vcpu_ack_pending_irq(struct vcpu *v,
                                            struct hvm_intack intack);
+
+/*
+ * Currently IA64 Xen doesn't support MSI. So for x86, we define this macro
+ * to control the conditional compilation of some MSI-related functions.
+ * This macro will be removed once IA64 has MSI support.
+ */
+#define SUPPORT_MSI_REMAPPING 1
+
 #endif /* __ASM_X86_HVM_IRQ_H__ */